home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / gfx / 3d / isl_1_2.lzh / ISL.BNF < prev    next >
Text File  |  1992-10-28  |  6KB  |  273 lines

  1. ISL.BNF - Copyright (c) 1992 John T. Grieggs, last modified 10-28-92
  2.  
  3. Current ISL version - 1.0.
  4.  
  5. This file describes the BNF for ISL, the Imagine Staging Language.  BNF is
  6. Backus Naur Form, a formal method for describing the syntax of a language.
  7. It should be fairly clear from the BNF what is allowable and what is not.
  8. This is a non-trivial document - I suggest you use ISL.doc to get an idea
  9. of what ISL is and does and how it works, then play with the destage and
  10. restage programs, and only then attempt to grok the grammar.
  11.  
  12. Before diving into the BNF, here are some things which are not in the BNF
  13. which are true of the ISL grammar.  Feel free to ignore the regular
  14. expressions and references to flex - they are included for the advanced
  15. user and should not be needed to understand the language.
  16.  
  17. 1)  Whitespace is optional.  You may have an entire stage on one line, or
  18.     may start a new line between any two keywords.  
  19.  
  20. 2)  STRING is a token which is bracketed by double quotes.  A legal string
  21.     may contain 0 or more of the characters [A-Za-z0-9\.\/\_\:].  Or, in
  22.     English, any upper or lower case letter, any digit, period, forward
  23.     slash, underscore, or colon.
  24.  
  25. 3)  U32 is a token which contains one or more digits.  It may not have
  26.     a decimal point nor a sign.  {DIGIT}+ is the flex pattern used.
  27.  
  28. 4)  FLOAT is a token which contains an optional minus sign, one or more
  29.     digits, a period, and zero or more digits.  \-?{DIGIT}+\.{DIGIT}*
  30.     is the flex pattern used.  Note that while six digits after the decimal
  31.     are always emitted by destage, zero or more are acceptable.  More than
  32.     five will bring you up against the Imagine rounding problems...
  33.  
  34. 5)  I have not attempted to spell out the meaning of each U32, FLOAT, and
  35.     STRING, on the theory that their meanings should be obvious based on
  36.     their position in the grammar.  For example, in camerahdr, defined
  37.     as CAMERA STRING, you have one keyword (CAMERA) and the name (STRING).
  38.     In this case, STRING would be the name of the CAMERA from the first
  39.     column of the Action editor.  A typical value for this clause would
  40.     be CAMERA "CAMERA".
  41.  
  42. 6)  : means definition, | provides alternates.  Eh?  Take the very first
  43.     part of the BNF for an example.  A stage may consist of a stagehdr
  44.     OR a stagehdr followed by a camera followed by globals followed by
  45.     objects.  These, in turn, are defined individually.
  46.  
  47. 7)  Optional clauses contain an empty : clause followed by one or more
  48.     | clauses.  An example would be genlockflag which is either :
  49.     (nothing) or GENLOCK.  The grammar is riddled with these, so make
  50.     sure you get it.  A stage may have zero or more objects, each of which
  51.     may have one or more positions, one or more alignments, etc.
  52.  
  53. Finally, here's the BNF:
  54.  
  55. stage
  56.     : stagehdr
  57.     | stagehdr camera globals objects
  58.  
  59. stagehdr
  60.     : STAGE MAXFRAMES U32
  61.  
  62. camera
  63.     : camerahdr positions alignments sizes
  64.  
  65. camerahdr
  66.     : CAMERA STRING
  67.  
  68. globals
  69.     : globalhdr globalchunks positions alignments sizes
  70.  
  71. globalhdr
  72.     : GLOBALS STRING
  73.  
  74. globalchunks
  75.     :
  76.     | globalchunks globalchunk
  77.  
  78. globalchunk
  79.     : ACTOR frames
  80.       BRUSH STRING U32
  81.       BACKDROP STRING U32
  82.       AMBIENT rgb HORIZON rgb +ZENITH rgb -ZENITH rgb
  83.       FOG btl FOG rgb
  84.       STARFIELD FLOAT TRANSITION U32 SKYBLEND U32 genlockflag
  85.  
  86. objects
  87.     :
  88.     | objects object
  89.  
  90. object
  91.     : objecthdr filechunks positions alignments sizes hinges effects
  92.     | lighthdr litechunks positions alignments sizes hinges
  93.     | axishdr axischunks positions alignments sizes hinges
  94.  
  95. objecthdr
  96.     : OBJECT STRING quickdrawflag
  97.  
  98. lighthdr
  99.     : LIGHT STRING
  100.  
  101. axishdr
  102.     : AXIS STRING
  103.  
  104. positions
  105.     :
  106.     | positions posnchunk
  107.     | positions pth2chunk
  108.  
  109. posnchunk
  110.     : POSITION frames xyz
  111.  
  112. pth2chunk
  113.     : POSITION frames PATH STRING ACCEL U32 FLOAT DECEL U32 FLOAT
  114.  
  115. alignments
  116.     :
  117.     | alignments algnchunk
  118.     | alignments palnchunk
  119.     | alignments talnchunk
  120.  
  121. algnchunk
  122.     : ALIGN frames xyz
  123.  
  124. palnchunk
  125.     : ALIGN frames PATH yhorizontalflag
  126.  
  127. talnchunk
  128.     : ALIGN frames OBJECT STRING YROTATION FLOAT FLOAT
  129.  
  130. sizes
  131.     :
  132.     | sizes osizchunk
  133.  
  134. osizchunk
  135.     : SIZE frames xyz
  136.  
  137. filechunks
  138.     :
  139.     | filechunks filechunk
  140.  
  141. filechunk
  142.     : ACTOR frames NAME STRING CYCLE FLOAT FLOAT reverseflag TRANSITION U32
  143.  
  144. litechunks
  145.     :
  146.     | litechunks litechunk
  147.  
  148. litechunk
  149.     : ACTOR frames sccshape shadowflag diminishflag rgb TRANSITION U32
  150.  
  151. axischunks
  152.     :
  153.     | axischunks axischunk
  154.  
  155. axischunk
  156.     : ACTOR frames
  157.  
  158. hinges
  159.     :
  160.     | hinges hingchunk
  161.  
  162. hingchunk
  163.     : HINGE frames OBJECT STRING
  164.  
  165. effects
  166.     :
  167.     | effects effect
  168.  
  169. effect
  170.     : EFFECT U32 frames Boing2.0 STRING
  171.       xyzaxis ucdsquash SHRINK FLOAT TIMES U32
  172.     | EFFECT U32 frames Fireworks STRING
  173.       srlshape xyzaxis EXPLOSION FLOAT FLOAT SCALING FLOAT
  174.       ROTATIONS FLOAT FLOAT EXPANSION FLOAT DISTANCE FLOAT SEED U32
  175.       sparkleflag
  176.     | EFFECT U32 frames Flash STRING
  177.       ON U32 OFF U32 startflag
  178.     | EFFECT U32 frames Grow STRING
  179.       YROT FLOAT XSCALE FLOAT
  180.       ZSCALE FLOAT XTRANS FLOAT ZTRANS FLOAT
  181.       alignyflag keepxflag mirrorflag reverseflag
  182.     | EFFECT U32 frames Ripple STRING
  183.       lrtoggle WAVELENGTH FLOAT ZAMP FLOAT TRAVEL FLOAT RIPPLES U32
  184.     | EFFECT U32 frames Rotate2.0 STRING
  185.       xyzaxis DEGREES FLOAT
  186.     | EFFECT U32 frames Tumble STRING
  187.       rzaxis ROTATIONS FLOAT FLOAT SEED U32
  188.  
  189. frames
  190.     : FRAMES U32 U32
  191.  
  192. xyz
  193.     : XYZ FLOAT FLOAT FLOAT
  194.  
  195. rgb
  196.     : RGB FLOAT FLOAT FLOAT
  197.  
  198. btl
  199.     : BTL FLOAT FLOAT FLOAT
  200.  
  201. xyzaxis
  202.     : XAXIS
  203.     | YAXIS
  204.     | ZAXIS
  205.  
  206. rzaxis
  207.     : RANDOMAXIS
  208.     | ZAXIS
  209.  
  210. ucdsquash
  211.     : +SQUASH
  212.     | SQUASH
  213.     | -SQUASH
  214.  
  215. srlshape
  216.     : SPHERICAL
  217.     | RADIAL
  218.     | LINEAR
  219.  
  220. sccshape
  221.     : SPHERICAL
  222.     | CYLINDRICAL
  223.     | CONICAL
  224.  
  225. sparkleflag
  226.     :
  227.     | SPARKLE
  228.  
  229. startflag
  230.     : STARTON
  231.     | STARTOFF
  232.  
  233. alignyflag
  234.     :
  235.     | ALIGNY
  236.  
  237. keepxflag
  238.     :
  239.     | KEEPX
  240.  
  241. mirrorflag
  242.     :
  243.     | MIRROR
  244.  
  245. reverseflag
  246.     :
  247.     | REVERSE
  248.  
  249. lrtoggle
  250.     : LINEAR
  251.     | RADIAL
  252.  
  253. shadowflag
  254.     :
  255.     | SHADOW
  256.  
  257. diminishflag
  258.     :
  259.     | DIMINISH
  260.  
  261. genlockflag
  262.     :
  263.     | GENLOCK
  264.  
  265. yhorizontalflag
  266.     :
  267.     | YHORIZONTAL
  268.  
  269. quickdrawflag
  270.     :
  271.     | QUICKDRAW
  272.  
  273.